home *** CD-ROM | disk | FTP | other *** search
Wrap
global gObjects, gCursorlist, cNullCast, gObjectsH, gStates, gWorld, NULLrect, gEnvironmentSound, sQTCharSprite on DoDefibPaddle2 DynamicLOCRECT(#DefibPaddle2) end on DoDefibPaddle1 DynamicLOCRECT(#DefibPaddle1) end on GrabDragDefibCable OBJref set H to the mouseH set V to the mouseV set OBj to getaProp(gObjects, OBJref) set OffsetH to H - the locH of sprite getaProp(OBj, #SpriteNum) set OffsetV to V - the locV of sprite getaProp(OBj, #SpriteNum) set cableref to getaProp(OBj, #CABLE) set Anchor to getaProp(getaProp(gObjects, cableref), #Anchor) if not voidp(getaProp(getaProp(OBj, #sound), #down)) then playSound(getaProp(getaProp(OBj, #sound), #down), #keyframeCast, #NOW) end if cursor(getaProp(gCursorlist, #Grab)) set constrainRect to getConstrainRect(OBJref) repeat while the mouseDown set hLoc to H - OffsetH set vLoc to V - OffsetV constrainSprite(hLoc, vLoc, constrainRect) set the loc of sprite getaProp(OBj, #SpriteNum) to the result set arect to rect(the locH of sprite getaProp(OBj, #SpriteNum) + 17, the locV of sprite getaProp(OBj, #SpriteNum) + 33, the locH of Anchor, the locV of Anchor) CableUpdate(cableref, arect) CursorandUpdate() CheckAmbientSound() set H to the mouseH set V to the mouseV end repeat cursor(getaProp(gCursorlist, #Hand)) if not voidp(getaProp(getaProp(OBj, #sound), #UP)) then playSound(getaProp(getaProp(OBj, #sound), #UP), #keyframeCast, #NOW) end if if not voidp(getaProp(getaProp(OBj, #Action), #UP)) then do(getaProp(getaProp(OBj, #Action), #UP)) end if DynamicLOCRECT(#DefibCable1) DynamicLOCRECT(#DefibCable2) end on doSyringe end on GrabPullPlunger OBJref set H to the mouseH set V to the mouseV set OBj to getaProp(gObjects, OBJref) set ObjH to the locH of sprite getaProp(OBj, #SpriteNum) set ObjV to the locV of sprite getaProp(OBj, #SpriteNum) set SpriteList to [] set ObjrefList to [] repeat with C in getaProp(OBj, #Children) set O to getaProp(gObjects, C) add(ObjrefList, C) add(SpriteList, [#SpriteNum: getaProp(O, #SpriteNum), #OffsetH: ObjH - the locH of sprite getaProp(O, #SpriteNum), #OffsetV: ObjV - the locV of sprite getaProp(O, #SpriteNum)]) end repeat set OBJcount to count(ObjrefList) if not voidp(getaProp(getaProp(OBj, #sound), #down)) then playSound(getaProp(getaProp(OBj, #sound), #down), #keyframeCast, #NOW) end if updateStage() set contrainRect to getConstrainRect(OBJref) set OffsetH to H - ObjH set OffsetV to V - ObjV repeat while the mouseDown set hLoc to H - OffsetH set vLoc to V - OffsetV set newLoc to constrainSprite(hLoc, vLoc, contrainRect) set the loc of sprite getaProp(OBj, #SpriteNum) to newLoc repeat with Snum in SpriteList set the loc of sprite getaProp(Snum, #SpriteNum) to newLoc - point(getaProp(Snum, #OffsetH), getaProp(Snum, #OffsetV)) end repeat CursorandUpdate() set H to the mouseH set V to the mouseV end repeat if not voidp(getaProp(getaProp(OBj, #sound), #UP)) then playSound(getaProp(getaProp(OBj, #sound), #UP), #keyframeCast, #NOW) end if updateStage() cursor(getaProp(gCursorlist, #Hand)) DynamicLOCRECT(#syringe) DynamicLOCRECT(#plunger) updateStage() end on getConstrainRect OBJref set OBj to getaProp(gObjects, OBJref) set halfWidth to the width of cast the castNum of sprite getaProp(OBj, #SpriteNum) / 2 set halfHeight to the height of cast the castNum of sprite getaProp(OBj, #SpriteNum) / 2 set constrainRect to rect(the left of sprite 1 + halfWidth, the top of sprite 1 + halfHeight, the right of sprite 1 - halfWidth, the bottom of sprite 1 - halfHeight) return constrainRect end on DoPlungerReset end on DoPlunger playSound("H12inj.aif", #keyframeCast, #NOW) set plungeSprite to getaProp(getaProp(gObjects, #plunger), #SpriteNum) set plungeLocH to the locH of sprite plungeSprite repeat with X = 1 to 7 set the locH of sprite plungeSprite to plungeLocH - (X * 3) CallAnimEngine() updateStage() end repeat set curState to getaProp(getaProp(gObjects, #heartAnimPar), #State) repeat with X = 6 down to 0 set the locH of sprite plungeSprite to plungeLocH - (X * 3) CallAnimEngine() updateStage() end repeat if curState = #threeclogs then set targetRect to rect(269, 69, 276, 77) checkShotRect(#twoclogs, targetRect) else if curState = #twoclogs then set targetRect to rect(264, 125, 271, 133) checkShotRect(#oneclog, targetRect) else if curState = #oneclog then set targetRect to rect(259, 183, 266, 189) checkShotRect(#noclogs, targetRect) if the result = 1 then setaProp(getaProp(gStates, #Conditions), #Heart, #true) PDARelease("J04m27j.mov") end if else end if end if end if end on checkShotRect OBJref, targetRect set needleLoc to the loc of sprite getaProp(getaProp(gObjects, #syringe), #SpriteNum) if inside(needleLoc, targetRect) then set Mobj to getaProp(gObjects, #heartAnimPar) DelObjects(getaProp(getaProp(Mobj, #SpecialChild), getaProp(Mobj, #State))) setaProp(Mobj, #State, OBJref) AddObjects(getaProp(getaProp(Mobj, #SpecialChild), getaProp(Mobj, #State))) return 1 else return 0 end if end on DoDefibZap set paddle1Loc to the loc of sprite getaProp(getaProp(gObjects, #DefibPaddle1), #SpriteNum) set paddle2Loc to the loc of sprite getaProp(getaProp(gObjects, #DefibPaddle2), #SpriteNum) if inside(paddle1Loc, rect(145, 71, 180, 106)) and inside(paddle2Loc, rect(241, 71, 277, 106)) then setaProp(getaProp(gStates, #Conditions), #Defibrillate, #true) DoStableGO() end if end on DoDefibPower set PowerObj to getaProp(gObjects, #DefibPower) set curState to getaProp(PowerObj, #State) set DefibObj to getaProp(gObjects, #DefibScreen) if curState = #open then if getaProp(getaProp(gStates, #Conditions), #Defibrillate) <> #true then DoDefibGO() else DoHeartGO() end if else DoTurnDefibOFF() end if end on DoStableGO set Mobj to getaProp(gObjects, #fibFdBckPar) DelObjects(getaProp(getaProp(Mobj, #SpecialChild), getaProp(Mobj, #State))) MakeDynamic(#fibFdBckPar, #State, #stable) AddObjects(getaProp(getaProp(Mobj, #SpecialChild), getaProp(Mobj, #State))) stopsound("H12ekg1.aif") playSound("H12ekg2.aif", #cast) end on doTextFldFormat put " " into field "PaPinText" set the textFont of field "PaPinText" to "Monaco" set the textSize of field "PaPinText" to 14 set the foreColor of field "PaPinText" to getIndex([8: 251, 16: 16, 32: 128]) set the textStyle of field "PaPinText" to "bold" put EMPTY into field "PaPinText" end on PaSelect NUM MakeDynamic(#PaPatients, #whichPatient, NUM) end on doBeep playSound("H09hi.aif", #keyframeCast, #NOW) end on PatientMenu OBJref findPatient() set OBj to getaProp(gObjects, OBJref) repeat while the mouseDown do(getaProp(getaProp(OBj, #Action), #WhileDown)) CursorandUpdate() end repeat if getaProp(OBj, #currect) <> #empty then set the castNum of sprite getaProp(OBj, #SpriteNum) to getaProp(getaProp(getaProp(OBj, #cast), getaProp(OBj, #currect)), #UP) set the loc of sprite getaProp(OBj, #SpriteNum) to getaProp(getaProp(getaProp(OBj, #PopMenu), getaProp(OBj, #currect)), #loc) updateStage() setaProp(OBj, #DisplayState, getaProp(OBj, #currect)) if not voidp(getaProp(getAt(getaProp(OBj, #PopMenu), getaProp(OBj, #currect)), #Action)) then do(getaProp(getAt(getaProp(OBj, #PopMenu), getaProp(OBj, #currect)), #Action)) end if end if playSound("H09hi.aif", #keyframeCast, #NOW) end on findPatient set H to the mouseH set V to the mouseV set OBj to getaProp(gObjects, #PaPatients) set aRectNum to InUnvRect(getaProp(OBj, #PopMenu), H, V) if aRectNum <> #empty then set the castNum of sprite getaProp(OBj, #SpriteNum) to getaProp(getaProp(getaProp(OBj, #cast), aRectNum), #down) set the loc of sprite getaProp(OBj, #SpriteNum) to getaProp(getaProp(getaProp(OBj, #PopMenu), aRectNum), #loc) else set the castNum of sprite getaProp(OBj, #SpriteNum) to cNullCast set the loc of sprite getaProp(OBj, #SpriteNum) to point(-2000, -2000) end if setaProp(OBj, #currect, aRectNum) end on TurnPaMonitorON set Mobj to getaProp(gObjects, #PaMonitor) playSound("H09monOn.aif", #keyframeCast) repeat with Casnum in getaProp(getaProp(Mobj, #cast), #on) set the castNum of sprite getaProp(Mobj, #SpriteNum) to Casnum updateStage() end repeat DoPaPatientGO() end on DoSetToOFF set Mobj to getaProp(gObjects, #PaMonitor) DelObjects(getaProp(getaProp(Mobj, #SpecialChild), getaProp(Mobj, #State))) MakeDynamic(#PaMonitor, #State, #off) MakeDynamic(#PaMonitor, #DisplayState, #INIT) end on DoPaPatientGO set Mobj to getaProp(gObjects, #PaMonitor) DelObjects(getaProp(getaProp(Mobj, #SpecialChild), getaProp(Mobj, #State))) MakeDynamic(#PaMonitor, #State, #Patients) MakeDynamic(#PaMonitor, #DisplayState, #Patients) AddObjects(getaProp(getaProp(Mobj, #SpecialChild), getaProp(Mobj, #State))) set the castNum of sprite getaProp(Mobj, #SpriteNum) to getaProp(getaProp(Mobj, #cast), #Patients) MakeDynamic(#PaPatients, #whichPatient, 0) end on DoPaPINGO if getaProp(getaProp(gObjects, #PaPatients), #whichPatient) = 0 then exit end if set Mobj to getaProp(gObjects, #PaMonitor) DelObjects(getaProp(getaProp(Mobj, #SpecialChild), getaProp(Mobj, #State))) MakeDynamic(#PaMonitor, #State, #PIN) MakeDynamic(#PaMonitor, #DisplayState, #PIN) AddObjects(getaProp(getaProp(Mobj, #SpecialChild), getaProp(Mobj, #State))) set the castNum of sprite getaProp(Mobj, #SpriteNum) to getaProp(getaProp(Mobj, #cast), #PIN) end on DoPaStatusGO set Mobj to getaProp(gObjects, #PaMonitor) DelObjects(getaProp(getaProp(Mobj, #SpecialChild), getaProp(Mobj, #State))) MakeDynamic(#PaMonitor, #State, #Status) MakeDynamic(#PaMonitor, #DisplayState, #Status) AddObjects(getaProp(getaProp(Mobj, #SpecialChild), getaProp(Mobj, #State))) set the castNum of sprite getaProp(Mobj, #SpriteNum) to getaProp(getaProp(Mobj, #cast), #Status) end on doNursevid set OBj to getaProp(gObjects, #NurseVid) set clickCount to getaProp(OBj, #clickCount) + 1 MakeDynamic(#NurseVid, #clickCount, clickCount) pickNurse(clickCount) set the movieRate of sprite sQTCharSprite to 0 set the movieTime of sprite sQTCharSprite to 0 set the movieRate of sprite sQTCharSprite to 1 end on doPeoplevid set OBj to getaProp(gObjects, #Peoplevid) set the movieTime of sprite getaProp(OBj, #SpriteNum) to 0 set the movieRate of sprite getaProp(OBj, #SpriteNum) to 1 end on DoGetSyringe if getaProp(getaProp(gObjects, #TubeObj), #Aquired) = #true then playSound("Click.aif", #keyframeCast, #NOW) updateStage() MakeDynamic(#TubeObj, #Aquired, #USED) MakeDynamic(#syrnObj, #Aquired, #true) set OBj to getaProp(gObjects, #GetSyringe) MakeDynamic(#GetSyringe, #State, #gone) MakeDynamic(#GetSyringe, #DisplayState, #gone) MakeDynamic(#GetSyringe, #Hotrect, [NULLrect]) set the castNum of sprite getaProp(OBj, #SpriteNum) to getaProp(getaProp(OBj, #cast), #gone) set hotrectnum to integer(getaProp(OBj, #SpriteNum) & "01") setaProp(getaProp(gHotRects, hotrectnum), #rect, NULLrect) AddObjects([#syrnObj]) end if end on doPatientName end on DoPaEnterPin end on doPinEntry end on doPower end on doLeftElectrode end on doRightElectrode end on doApplyShock end on doMagnify end on doShrink end on goToH05 end